<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="../../mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>我的订单</title>
    <t:base type="jquery"></t:base>
    <script type="text/javascript" charset="utf-8">
        mui.init();
    </script>
    <style>
        .gd h3{
            padding:5px 0;
        }
        .gd{
            margin-left:5px !important;
            float:right !important;
            width:60%
        }
    </style>
</head>
<body>
<div class="fp_t">订单列表</div>
<div class="chanp chanp1" style="margin-top: 10px;">
    <ul>
        <c:forEach var="note" items="${notes}">
            <c:if test="${not empty note.partList}">
                <li class="mui-clearfix" onclick="location.href='purchaseorderController.do?wxOrderDetail&id=${note.id}&from=normal'">

                    <h1>订单编号：${note.procurementNo}&nbsp;&nbsp;&nbsp;&nbsp;
                        <%--总额 &nbsp;¥<fmt:formatNumber type="number" pattern="#,##0.00" value="${note.totalPrice}"/>--%></h1>
                    <c:forEach var="part" items="${note.partList}" >
                        <div class="mui-clearfix hy">
                            <a>
                                <c:if test="${not empty part.partInfo.partImgList}">
                                    <img style="height:100px;padding:5px 0px 5px 0px;" src="cbsPartInfoController.do?downLoadFile&filePath=${part.partInfo.partImgList[0].allPath }">
                                </c:if>
                                <c:if test="${empty part.partInfo.partImgList}">
                                    <img style="height:100px;padding:5px 0px 5px 0px;" src="cbsPartInfoController.do?downLoadFile&filePath=${part.partInfo.filePath }">
                                </c:if>
                            <div class="gd gd1" style="padding: 5px 0px 5px 0px;">
                                <h2 style="font-weight: bold">${part.partInfo.wechatName}</h2>
                                <h3 class="price-group">
                                    <span>¥<fmt:formatNumber type="number" pattern="#,##0.00" value="${part.price}"></fmt:formatNumber></span><br/>
                                    <span>¥<fmt:formatNumber type="number" pattern="#,##0.00" value="${part.partInfo.terminalPrice}"></fmt:formatNumber></span>
                                </h3>
                                <h3><span style="color: #333333;font-size:12px;margin-left:0px;">X${part.num}</span></h3>
                            </div>
                            </a>
                        </div>
                    </c:forEach>
                    <div class="order-list-sum">
                        <span style="font-size:0.8em;color:#a6aaab;float:left">订单创建时间&nbsp;<fmt:formatDate value="${note.createDate}" pattern="yyyy-MM-dd HH:mm"/></span>
                        <span style="font-size:1em;color:#a6aaab;float:right">合计&nbsp;<span style="color:red">¥<fmt:formatNumber type="number" pattern="#,##0.00" value="${note.totalPrice}"/></span></span>
                    </div>
                </li>
            </c:if>
        </c:forEach>

    </ul>
</div>
</body>
<script type="text/javascript">
    $(function(){
        $(".note-state-color").each(function(){
            var o = $(this);
            var color = "red";
            switch (o.attr("data-state")){
                case "2":
                    color = "#30c07b";
                    break;
                case "1":
                    color = "#0286c6";
                    break;
                case "0":
                    color = "#e30015";
                    break;
            }
            o.css("color",color);
        })
    })
</script>
</html>